/** 用户信息 */

import { request } from '@umijs/max';

export async function getUserInfo() {
  return request('user/own', {
    method: 'GET',
    headers: {
      'Content-Type': 'application/json',
    },
  });
}
/** 登录接口 POST /api/login/account */
export async function login(body: API.LoginParams, options?: { [key: string]: any }) {
  return request<API.LoginResult>('user/login', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  });
}
// import 获取固定路由
export async function currentUserMenus() {
  console.log('currentUserMenus');

  return {
    data: [
      {
        icon: 'smile',
        path: '/system',
        name: 'system',
        children: [
          {
            icon: null,
            path: '/system/empty',
            name: 'empty',
          },
          {
            icon: 'smile',
            path: '/system/rolelist',
            name: 'role',
          },
        ],
      },
    ],
  };

  // return request('/api/org/getUserMenus', {
  //   method: 'GET',
  // });
}
